<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>组件--工具框</title>
    <script src="../echarts.min.js"></script>
</head>
<body>
    <div id="main" style="width: 600px ;height: 400px;"></div>
</body>
<script>
    let mychart = echarts.init(document.getElementById("main"))
    let option = {
        title:{
            text:"Echarts组件的学习",
            subtext:"工具框",
            left:'center'
        },
        tooltip:{},
        xAxis:{
            data:["产品A","产品B","产品C","产品D","产品E"]
        },
        toolbox:{
            show:true,
            feature:{
                mark:{show:true},
                dataView:{show:true},
                magicType:{show:true,type:['line','bar']},
                restore:{show:true},
                saveAsImage:{show:true}
            }
        },
        legend:{
            data:["各产品销量图"]
        },
        yAxis:{},
        series:[{
            name:"销量",
            type:'bar',
            data:[900,700,550,1000,200,850]
        }]
    }
    mychart.setOption(option)
</script>
</html>